#ifndef COMMSIGNALSLOT_H
#define COMMSIGNALSLOT_H

#include <QObject>
#include <QDateTime>
#include <QTime>

#define TIMEMS          qPrintable(QTime::currentTime().toString("HH:mm:ss zzz"))
#define TIME            qPrintable(QTime::currentTime().toString("HH:mm:ss"))
#define QDATE           qPrintable(QDate::currentDate().toString("yyyy-MM-dd"))
#define QTIME           qPrintable(QTime::currentTime().toString("HH-mm-ss"))
#define DATETIME        qPrintable(QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss"))
#define STRDATETIME     qPrintable(QDateTime::currentDateTime().toString("yyyy-MM-dd-HH-mm-ss"))
#define STRDATETIMEMS   qPrintable(QDateTime::currentDateTime().toString("yyyy-MM-dd-HH-mm-ss-zzz"))

#define MyDATETIMEMS    qPrintable(QDateTime::currentDateTime().toString("MM-dd HH:mm:ss zzz"))

class UsrCommImpl : public QObject
{
    Q_OBJECT
public:
    UsrCommImpl();

    static UsrCommImpl* Instance();

    enum logType{
        logSTR = 0,
        logDateTime,
        logHex,
        logHZ
    };

    Q_ENUM(logType);

signals:
    void CommSignalLog(const QString&);

public slots:
    void CommSlotLog(enum logType, const QString&, const QString&);
    
public:
    static QString byteArrayToHexStr(const QByteArray &data);
};

#endif // COMMSIGNALSLOT_H
